fixing a bug in the CSV method