make sure no insert is left unfinished when closing the annotations dialog