made the mongo connections a bit more flexible