bug fix with csv generation