fix bug when finding new leader.
Merge remote-tracking branch 'origin/master'