update fsm system and add a example