fix duplicated call of onDisconnect()