handle request errors correctly