support persistant replication and stopping infinite loop