fix a bug in MCMC