fix replica shell script