fix bug: can't save document