Fix probability function