fix a script replace bug