fixing randomness