Change `run_forever` to use onDisconnect