Added local storage functionality