connects to mongoDB