fixed a bug causing lines to be displayed multiple times