fixing localstorage bug