bugfix in tab switching