added fsm, need to fix freezes