updated saving of relations