prevent a document from getting added multiple times in the document manager