Modified code to use the new ldapSearchLookup(key) function