Fixed a potiental bug with widget initalization