added select tab functionality