Do not select Tabs on destroy

I'm using the onSelect function to save the status of the last active tab in the sessionStorage. But if you call the select function when destroying the tabs it overwrites the index of the latest tab.

It would make more sense to me. What do you think?