define function when central tab changes