fix a bug with the mcmc sampling.