a little fix of unregistering