added logic to addTab method to get click events