fixed a bug with adding/deleting vertices