error handling for retrieve all case