fix tab switching