changed tab logic