fix bugs with csv data export