mongodb connection improvement