fix bug in deleting notes