Properly closing widget