patched up tab switching