trycatch for mcmc