added logging to diagnose error while unregistering
removed dead code
Merge pull request #6 from BIAINC/error-unregistering

added logging to diagnose error while unregistering