Update FiniteStateMachine.js