Uses OnLoaded and OnUnloaded hooks to properly change tabs