added deregister functionality