fix for failing export to csv

Fixed export CSV error