added window. to localStorage calls