added support for mongodb connection reuse