state machine work...