Added handling for disconnection of clients