fix replace script