fixing rng bugs