Fix tab selection issue