Update StateMachine.cpp