improve localstorage in library