nevermind.  This doesn't work since the static_tab_idx is keeping track of the index of only the static tabs that are found, not all the tabs.