This should actually fix the game playing once the window is closed