fix random number initialization