close connection when dealloced