Add state-machine