working on fsm lib; bug in eventhandling