Fixed error in response handling