replace script fixed