writing to csv - but currently only writing info for the last merchant ID as other data is being overwritten