added check for mongoclient