apply the same check on empty rootfolder to rm