fix internal error occurred if the document including trash items is saved.