changed to generate random number each time