fix bug when adding previously removed relations