Fix number of csv array elements in json array

- Output file name written in write() method
was there an out of array error?