Added more intelligent search for the ldap tree