fixed missing function in toCSV and toTSB