Put replace in the right place