close connection after sending response