regulate random number generator