Fix document update error on multiple saves