get correct dir, set env var