fixed a bug where duplicate vertices of a polygon were getting added