Modify unregister method