save the scratchpad using localstorage