fix unregistration
Merge pull request #1090 from shackbarth/unregister

fix unregistration