get CSV exporting working