how to fix self intersecting polygons