add localStorage, fix #3770