Setting up the StateManager controller