add threshold support to continuousQueries