improve tab switching