changing order of file paths, temp file comes first