added disconnected events and logic to track connected clients