         hideQuestions = self.evaluateCondition(operator, answer, self.getValue($triggerElement))
         if matchingCondition.length > 0
           if conditions.length > 1
-            self.checkConditionsAndHideShow(conditions, ancestorId, $ruleElement, $container, matchType)
+            self.checkConditionsAndHideShow(conditions, ancestorId, $ruleElement, matchType)
           else
-            self.hideShowQuestions(hideQuestions, ancestor_id, $ruleElement, $container)
+            self.hideShowQuestions(hideQuestions, ancestor_id, $ruleElement)
     return
 
-  checkConditionsAndHideShow: (conditions, ancestorId, $ruleElement, $container, matchType) ->
+  checkConditionsAndHideShow: (conditions, ancestorId, $ruleElement, matchType) ->
     conditionMetTracker = []
     _.each conditions, (condition) ->
       $conditionElement = $("[data-question-id=" + condition.question_id + "]").find('.form-control')

    # match type any (or)
    if matchType == "any"
      if _.indexOf(conditionMetTracker, true) > 0
        self.hideShowQuestions(false, ancestorId, $ruleElement, $container)
      else
        self.hideShowQuestions(true, ancestorId, $ruleElement, $container)
    # match type all
    if matchType == "all"
      if _.indexOf(conditionMetTracker, false) == -1
        self.hideShowQuestions(false, ancestorId, $ruleElement, $container)
      else
        self.hideShowQuestions(true, ancestorId, $ruleElement, $container)


  #hide or show questions
  hideShowQuestions: (hide_questions, ancestor_id, $ruleElement, $container) ->
    all_questions = $container
    all_questions << $($container).find(".form-container-repeater[data-question-id=" + ancestor_id + "],[data-question-id=" + ancestor_id + "],[data-ancestor=" + ancestor_id + "]")
    if hide_questions
      all_questions.addClass("conditional-logic-hidden")
      self.clearQuestions(all_questions)
    else
      all_questions.removeClass("conditional-logic-hidden")

  #clear questions
  clearQuestions: (container) ->

      #console.log rule
      $(rule.conditions).each ->
        $ruleElement = $ruleElement
        condition = this
        #console.log condition
        questionId = condition.question_id
        $triggerContainer = $ruleElement.closest('.form-container-survey').find("[data-question-id=" + questionId + "]")
        # getting element on edit and new page
        $triggerElement = $triggerContainer.find(".form-control")
