fixed bug that caused the game to not end correctly, when cancelled