Add state machine.