Fix cors implementation. Delete relations when updating field