Fixed bug swithing between game states.