fix new line logic