remember which tabs have been selected to re-select the last tab when the selected tab is closed