Fixed "<function> is not defined" error when binding to the onchange event of the ToggleSwitch