Fix CSV data undefined output issue