Fix a bug that the connection is not closed after the response.