bug with array casting in getProbability solved