Bug fixing - using localStorage instead of sessionStorage