fix function: random number unlimited looping