the code below output this error please fix and update the code 

Error: line 56, in on_create_new_word
    self.create_entry_dialog(query)
  File "/home/sal/i/code/personal_dictionary/dictionary_app.py", line 79, in create_entry_dialog
    dialog.get_content_area().add(box)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Box' object has no attribute 'add'


Code:

import gi
gi.require_version('Gtk', '4.0')
from gi.repository import Gtk, GLib, Gio
import sqlite3
import sys

class DictionaryApp(Gtk.Application):
    def __init__(self):
        super().__init__(
            application_id="org.example.DictionaryApp",
            flags=Gio.ApplicationFlags.FLAGS_NONE
        )
        self.window = None
        self.db_path = "dictionary.db"

    def do_activate(self):
        if not self.window:
            self.window = Gtk.ApplicationWindow(application=self)
            self.window.set_title("Personal Dictionary")
            self.window.set_default_size(400, 300)

            box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
            self.window.set_child(box)

            self.entry = Gtk.Entry()
            box.append(self.entry)

            self.result_view = Gtk.TextView()
            self.result_view.set_editable(False)
            box.append(self.result_view)

            self.search_button = Gtk.Button(label="Search")
            self.search_button.connect("clicked", self.on_search_clicked)
            box.append(self.search_button)

            self.create_button = Gtk.Button(label="Create New Word")
            self.create_button.connect("clicked", self.on_create_new_word)
            box.append(self.create_button)

            self.window.present()

    def on_search_clicked(self, button):
        query = self.entry.get_text()
        if query:
            result = self.search_word(query)
            if result:
                buffer = self.result_view.get_buffer()
                buffer.set_text(result)
            else:
                buffer = self.result_view.get_buffer()
                buffer.set_text(f"No definition found for '{query}'. Do you want to create a new entry?")

    def on_create_new_word(self, button):
        query = self.entry.get_text()
        if query:
            self.create_entry_dialog(query)

    def search_word(self, word):
        try:
            conn = sqlite3.connect(self.db_path)
            c = conn.cursor()

            c.execute("SELECT definition FROM words WHERE word = ?", (word,))
            row = c.fetchone()
            if row:
                return row[0]
            return None
        except sqlite3.Error as e:
            print(f"Error accessing database: {e}")
            return None
        finally:
            if conn:
                conn.close()

    def create_entry_dialog(self, word):
        dialog = Gtk.Dialog(title="Create New Entry", transient_for=self.window, modal=True)

        box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
        dialog.get_content_area().add(box)

        label = Gtk.Label(label=f"Enter definition for '{word}':")
        box.append(label)

        entry = Gtk.Entry()
        box.append(entry)

        def create_entry():
            definition = entry.get_text()
            if definition:
                try:
                    conn = sqlite3.connect(self.db_path)
                    c = conn.cursor()

                    c.execute("INSERT INTO words (word, definition) VALUES (?, ?)", (word, definition))
                    conn.commit()
                    conn.close()

                    self.result_view.get_buffer().set_text(f"New entry created for '{word}'.")
                except sqlite3.Error as e:
                    print(f"Error creating entry: {e}")
                    self.result_view.get_buffer().set_text(f"Failed to create entry for '{word}'.")
                finally:
                    if conn:
                        conn.close()

        cancel_button = Gtk.Button(label="Cancel")
        cancel_button.connect("clicked", lambda _: dialog.destroy())

        create_button = Gtk.Button(label="Create")
        create_button.connect("clicked", create_entry)

        box.append(cancel_button)
        box.append(create_button)

        dialog.add_buttons("Cancel", Gtk.ResponseType.CANCEL, "Create", Gtk.ResponseType.OK)
        dialog.connect("response", lambda dialog, response_id: dialog.destroy())
        dialog.present()

    def do_startup(self):
        Gtk.Application.do_startup(self)

if __name__ == "__main__":
    app = DictionaryApp()
    app.run(sys.argv)