fix editing of existing polygons

Issue #50