add the widget and db function