bugfixes for localstorage