fixed bug in game logic