Added function to unregister