Add an onDisconnected function and visual feedback