changed readAll by read line by line.