fixed bug of select tab logic