fixed bug with redundant lines