fix #4484: avoid overwriting input files