fixes numbering for output files