Fix localstorage history clearing