fixed a bug in stochastic-beam search