LDAP error throwing fix