Update all instances of duplicate $id checks