closes mongo connection after callback