handling bad requests from server