Fixed bug when localstorage was empty.