Fix the document removal