adding intersection and isvalid