rng bug fix