Corrected error in if backet
Connects and disconects upon each ldap search