Added Check to value of random number