close the connection after sending the response