fixed some bugs when saving a note