solved a random number issue