more error handling for mongo connections