fix exception when mongodb is down