updated to import metrics earlier