clean metrics on error