check condition in addDocuments