add the storing of last active tab