added support for range queries