updated some of the queries in validate_rule model