Fix bug when there is no MongoClient