add support for NOT option in queries