Fixing some bug in localstorage.