fix count_lines