the data reading was split with " " (space) which in the while read kept it as one row, changed the split character to "\n"