before gamestate changes