added collect error metrics
added collect error metrics