Replacing metadata file in the correct place in the code so that two destinations don't overwrite the same file before transfer