Fixed bug where note is being deleted when editing