Calling unregister instead of manually unregistering