Agents were duplicated when executing queries using the lookupIdentityById.