fix writecsv to write display to file