Need help with Dock Widget Buttons

Hi there! I am trying to get my script to run for when I click a button on my Dock Widget. When I try and start up the plugin I get this error: 19:41:13.247 user_Edit_RT.rbxmx.Edit_RT.Main:28: attempt to index boolean with 'MouseButton1Click' - Studio - Main:28

Here is my code:

local Toolbar = plugin:CreateToolbar("Route Tag Editor")
local Button = Toolbar:CreateButton("RT# Editor","Edits the Number for the route tag","rbxassetid://6395321550")
local StartGUI = script.Parent.DirFrame

local Toggle = 0

local widgetInfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Left,  -- Widget will be initialized in floating panel
	true,   -- Widget will be initially enabled
	false,  -- Don't override the previous enabled state
	200,    -- Default width of the floating window
	300,    -- Default height of the floating window
	150,    -- Minimum width of the floating window (optional)
	150     -- Minimum height of the floating window (optional)
)

local Widget = plugin:CreateDockWidgetPluginGui("Route Tag Editor", widgetInfo)
Widget.Title = "Route Tag Editor"
Widget.Name = "Route Tag Editor"
local sGUI = StartGUI:Clone()
sGUI.Parent = Widget
Widget.Enabled = false

local function whenClicked()
	Widget.Enabled = not Widget.Enabled
end

Widget.DirFrame.Active.MouseButton1Click:Connect(function()
	if Toggle == 0 then
		script.Parent.Text = "Searching..."
	end
end)

Button.Click:Connect(whenClicked)

(All the Variables are correct)

Any ideas why??

Edit - Figured out the issue(mistyped)