try making get_ldap_data safer