fixed random number issue