Add a return value check routine