fixed error in game logic