random number generator fix