fix exception if response is not successful