fix polygons being incorrectly removed