Fix a class bug and add local storage