deregister and reregister