improved adding documents in batch.