fixed edge addition bug