deleted 1 line
added condition if line intersects