input validation & local storage