update widget to function