Update statemachine.lua