improving tab functionality2