fix bug when saving widget settings