add global var to know the current index tab