bug fix in getEntropy