auto choose tab logic changed