update the current index when adding/removing/moving a tab