correcting incorrect file extension on output file