mongodb initial conversion

added error handling for situation where mongodb
is not accessible