error handling in csv export