fixing edge filtering on weight