stateManager.js updated.