Make mongo connection dynamic