fixes tab switching error