fix bugs in LinesManager