Add/Remove Button script Breaks Activity Tab Lead Doctype

frappe.ui.form.on('Lead', {
    refresh(frm) {

        // Add the 'Add Task' button
        frm.add_custom_button(__("Add Task"), function(){
            console.log("Add Task button clicked");

        frm.add_custom_button(__("New Opportunity"), function(){
      frm.add_custom_button(__("Add Meeting"), function(){

        // Add the 'Send Email' button
        frm.add_custom_button(__("Send Email"), function(){
            console.log("Send Email button clicked");

        var bt = ['Customer', 'Opportunity', 'Quotation', 'Prospect']
            //, 'Create')
  , 'Create');

Breaks Activity Tab

How to remove button successfully?

Thanks in Advance

Hi @cmdeep,

Hide/Remove button for check the documentation.

And we applied the your code but Activity tab not broken.

Thank You!