store code in localstorage