Fix an issue that arises when no tab is active