random number error fix