update edges
fix a bug