added fsm support