events for tabs refactored