better handling of bad request responses