csv export
refactored to use a promise on saving