fix prevalence query in range pattern