close connection on close