implement Behavior when tab changes