state machine added