fix bugs for addState and notes.html