Use lscript() instead of replace().