fix connection to MongoDB