working on fsm_init()