switch tabs when a tab is closed