fixed a bug dealing with deleting notes