fix dangling vertex bug