Good point. I'll move this inside the if statement to only run if its the LDAP type search.