fixed random numbers bug