fixed a bug where certain intersections caused a panic