bug fix and add metric name extractor