     $triggerElement.on "change", ->
       # pop out of condition into rules to handle all conditions defined in the rule
       # TODO it seems this is looping through ALL data-rule in the DOM instead of the data-rule associated with the element that triggered the onchange event-kdh
-      $("[data-rule]").each ->
+      $($triggerElement).closest(".form-container-repeater").find("[data-rule]").each ->
         $ruleElement = $(this)
+        $container = $(this).closest(".form-container-repeater")
         rule = $.parseJSON($ruleElement.attr("data-rule")).rule_hash
         matchType = rule.match_type
         questionId = $triggerElement.closest('.form-container-entry-item').attr('data-question-id')

class ConditionalLogic

  self = ConditionalLogic.prototype


                self.bindConditions(rule.question_id, $(element), condition.operator, condition.answer)
        # hide show questions
        if rule.conditions.length > 1
          self.checkConditionsAndHideShow(rule.conditions, ancestorId, $ruleElement, $container, matchType)
        else
          self.hideShowQuestions(hideQuestions, ancestorId, $ruleElement, $container)
    return

  #bind conditions to question
