added collect error metrics