implement connection close