fix $response->end() error