fix error returning response when connnection is reset