Added hadling client disconnect functionality