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

    $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 ->
        $ruleElement = $(this)
        rule = $.parseJSON($ruleElement.attr("data-rule")).rule_hash
        matchType = rule.match_type
        questionId = $triggerElement.closest('.form-container-entry-item').attr('data-question-id')

        hideQuestions = self.evaluateCondition(operator, answer, self.getValue($triggerElement))
        if matchingCondition.length > 0
          if conditions.length > 1
            self.checkConditionsAndHideShow(conditions, ancestorId, $ruleElement, $container, matchType)
          else
            self.hideShowQuestions(hideQuestions, ancestor_id, $ruleElement, $container)
    return

  checkConditionsAndHideShow: (conditions, ancestorId, $ruleElement, $container, matchType) ->
    conditionMetTracker = []
    _.each conditions, (condition) ->
      $conditionElement = $("[data-question-id=" + condition.question_id + "]").find('.form-control')
