fix to primary relationship addition logic ans extRif extrif issues