ToDo: How to handle csv generation when errors present?