Fixing issue where the primary_record is removed by a later update