update widget logic