added DisconnectionDetector, fixed bugs