fix end game logic
fix logic