fix exception when client connections are disconnected