fix RuntimeError in del_vertex