fixed creation of polygons