fixed minor string manipulation that didn't account for multiple instances of a substring.  See e-support QYQ-125501 for details