fix markov bug