MainActivity game fixed #5
now the game ends properly