fsm : add when_entering and when_leaving, rename exiting to leaving