refactored code so that model only uses one ldap connection TODO: close connections
try blocks around connection routines