Added a check that valid metric value exists in repo before checking R. Otherwise, give a more informative error message