Made connection to MongoDB synchronous.