iproved version of ExportCSV