Add unregister function.