fix bernoulli