improved SwitchTo in error case