bug fix for replacements