Remove debugging and add ldap cancellation