Fixed threading issue on game end