fix dtype error in batchToCSV