iimproved mongo connection