Needs to be updated equivalently to the code in completeContactLinking.