fix the way to determine the line