Added fix a bug when the newline comes late