fixed duplicate edges