make sure we loop only if needed for rootfolder var