Fix bug when Mongo server is not running