Adding update code to widget