added localstorage functionality