only try renaming temp file if it's in temp dir