more robust way to set rootDir