fix dont close ldap conection too soon