implemented the server-based unregister-code