An application of Groebner basis on planarity of intersections of surfaces