fixed a small bug with the output file naming.