connect to mongodb on startup