changing CCMenu priority

i have an error when changing priority of CCMenu object in onEnter() cuz touch delegate wasn’t add though i’m calling registerWithTouchDispatcher() before changing priority
heres the code:

void InviteFriendsDialog::onEnter() { CCLog("Entering"); //CCTouchDispatcher::sharedDispatcher()->init(); if(!this->getIsTouchEnabled()) this->setIsTouchEnabled(true); // calls registerWithTouchDispatcher() so dont need to call it CCLayer::onEnter(); //this->registerWithTouchDispatcher(); CCTouchDispatcher::sharedDispatcher()->setPriority(kCCMenuTouchPriority-2, socialButtons); CCTouchDispatcher::sharedDispatcher()->setPriority(kCCMenuTouchPriority-2, quitButton); }

`void InviteFriendsDialog::onExit()
{
CCTouchDispatcher::sharedDispatcher()->removeDelegate(this);
CCLayer::onExit();
}

void InviteFriendsDialog::registerWithTouchDispatcher()
{
CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(this, kCCMenuTouchPriority-1, true);
}`

CCTouchDispatcher::sharedDispatcher()->setPriority(kCCMenuTouchPriority-2, socialButtons);
CCTouchDispatcher::sharedDispatcher()->setPriority(kCCMenuTouchPriority-2, quitButton);

the menuitem is not add to the Dispatcher,so it do not have effact

but CCLayer::onEnter(); should add it …Am i wrong?
besides adding it in registerWithTouchDispatcher() like

CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(socialButtons, kCCMenuTouchPriority-2, true);
CCTouchDispatcher::sharedDispatcher()->addTargetedDelegate(quitButton, kCCMenuTouchPriority-2, true);

results is a assertion saying that it was already added!

can any1 help me on this case…cuz i spent much more time on it that was given for this task