infinity loop workaround for multipolygons