State Machine Demo Bug Fixes

Run statemachine gui from function now.