fixed bug when mongoclient was overwritten