DensityDist error after sampling

Found the solution here: