fix ldap code