update js, handle disconnect, improve game state