wrong logout url on multisite. user log out not going back to the main site

Surhcy.com is network installed with buddypress. We have three multi sites running besides surchy. I am able to log in via main site surchy.com. However, when i go to the multi site specifically cancer.surchy.com, I can see the user on the top. But when I click on the logout for that user, it takes me to the yahoo link and does not log me out correctly. However if I go back to the main site, I am able to log out correctly. Problem with ther multi site logout url which is taking it to the subsite link and not to the main site logout . You can see the url of the user on the attachment.

the wp-config is working fine with multi site enabled.

Any suggestions?