altered subst to deal with strings