added tieCondition to js