handle bad response gracefully