fix unregister script.