Change tabs logic