query rule working