Handles invalid response