this is working with back button, close tab, and refresh tab.