Changed the script to remove the index from the file name too