INVALID error message fix needed

I fixed the bug for the next version 19.07 - trying to prevent saving the INVALID and try to recover old documents that did have the INVALID saved.