Fixed output file to csv