bug fix for excluding extra edges