rename state to fsm