Fixed is_leader bug