You could try setting `orderManager.Connection.ConnectionState = ConnectionState.NotConnected` however it looks like this is readonly here so maybe just do the same as `disconnectButton.OnClick = () => { CloseWindow(); onExit(); };` to have it go back to the lobby instead of crashing.