Update replication.c

add more debug