connects to mongodb