add resize callback
add replication demo