For some reason renaming a file created a new file and deleted the old one