added unregister
added test