added active tab functionality