fix bug in feature-probability function