fix a line counting bug