get_ldap_results now returns an error code
using this should avoid crashes on missing attributes
add error handling to get_ldap_connection