added localstorage to prevent loss on input