trying to fix bug with renaming files