when output is csvs and flag is on, call the new csvs.insertRecord function, otherwise call csvs.updateRecord