fixed a bug where all the edges dont get added