Add state machine