proper handling of show/hide widgets