Solved the "current tab" issue with sessionStorage