fix bug initializing gameWindow in statemanager