proper error handling in pmcmc