fix random number selection