It seems that most times first replication is already complete before second checks activeReplications, so two processes are started. Any idea how to avert it?