fix bug when local storage is empty