updated widget code