handling requests errors