resolved overwriting output files issue