fix close connection when client leaves