switches tabs correctly