fix bug with edges