Fixed a hibernate error that occurred on removing a note that has just been added