added funcitionality for when the game ends