get replication scratch script working again