added recursion in StrSubstitutor