         $repeater.find("[data-rule]").each ->
           inRepeater = true
           $ruleElement = $(this)
-          $container = $(this).closest(".form-container-repeater")
+          #$container = $(this).closest(".form-container-repeater")
+          $container = $ruleElement
           rule = $.parseJSON($ruleElement.attr("data-rule")).rule_hash
           matchType = rule.match_type
           questionId = $triggerElement.closest('.form-container-entry-item').attr('data-question-id')


  #hide or show questions
  hideShowQuestions: (hide_questions, ancestor_id, $ruleElement, $container, inRepeater) ->
    all_questions = $($container).find(".form-container-repeater[data-question-id=" + ancestor_id + "],[data-question-id=" + ancestor_id + "],[data-ancestor=" + ancestor_id + "]")

    # deal with container
    unless $container.hasClass("form-container-survey")
      if hide_questions
        $container.addClass("conditional-logic-hidden")
        self.clearQuestions($container)
      else
        $container.removeClass("conditional-logic-hidden")

    # deal with questions
    if hide_questions
      all_questions.addClass("conditional-logic-hidden")
      self.clearQuestions(all_questions)
    else
      all_questions.removeClass("conditional-logic-hidden")

  #clear questions
  clearQuestions: (container) ->

        $($triggerElement).closest(".form-container-survey").find("[data-rule]").each ->
          inRepeater = false
          $ruleElement = $(this)
          #$container = $(this).closest(".form-container-survey")
          $container = $ruleElement
          rule = $.parseJSON($ruleElement.attr("data-rule")).rule_hash
          matchType = rule.match_type
          questionId = $triggerElement.closest('.form-container-entry-item').attr('data-question-id')
