use patched replacestream