fix tab selection issue