fixes for unload and widget