fix bug for addVertex