fix response body in case of an error