fix rng bug