fix self edges