fix LocalStorage is not defined