fixing bugs with infinite lines