bug fix for non-initialized random variable