Currently, we were testing the first tab for autoconnect. However, in case of persistent tabs, that doesn't work. Since autoconnect is the last tab that gets added in that case. So we need to check the current active tab