Fix: Use opened tab instead of active tab.