Update to widget

adding in some error checking and some style