Fix to tab switching