fix widget code