fixed bug in handle_declare_leader