segment intersect not working