add check for replication