Fix SwitchTabs function