fixes the tab switch problem