export to csv correctly