add local storage functionality