fixed bug when renaming folders and files.