fixed errors in intersect()