fix the mongodb connection