Fixing bug for undo - tabsArray was incorrectly being modified with stale tabId.