fixed naming bug for output files