added in trycatch to troubleshoot cov function