save to localStorage function update