Fix a bug multiple substituting