next_line bug fix