fixed duplicate edges.