fix crash on game page refresh