check for return code