close to working MongoDB connection