closeConnection and sendResponse