fix switching between gamestates