improving tab functionality