initial draft of detecting when the tabs need to change