Intersection check function correction