intersectTest function fix