string replacement avoids infinity recursion now (skips last replacement)