Add election handler for replicas.