update mongo connection handling