Fixed a bug of note_id = 0 when saving