adding control structure in renaming of files