add state machine again