check return code