adding local storage functionality