fix insert method when lot of documents are in db;