fixing bug with line that ends abruptly, more levels