fix bug from localstorage