Fix: get next line logic