added checking of mongodb