add create function for widget