implemented purgeDocs()