added active field in query_rules