Create state machine(update)