take care of the last line which do not have "\n"