add deduplication for rules