fix widget not closing bug