issue 78 Fix bug with unregistering