fix: StateManager state switching #1182

fix for issue #1182