fixed indexing issue with outgoing edges