fix NameError when metrics.json not available