fixed the way of examining the value of leader id