Added localstorage functionality