Fixed how to add state machine replication, based on junfeng's comments.