This change ensures the file extension is added when renaming