fix a bug with percentile when there are no values