correcting logic in updatewid