add hasRelated and unset relation if delete is called