fixed functionality in Graph.addEdge()