Improved querycounter logic
Allow checking rules
ui fix