fixing problems with detecting a disconnected client