Check the return code