fixed bug with empty localstorage