bug fix for edges