Fix issue in reordering the vertices