fix bugs about the game logic