fixed a bug where components were not removed from the gui when the selected tab changes