added state machine as local file, added reactivity to current var