Fixing randomization
Fix disconnection crash.