Bug Fix about adding edges