update with main script and new multi-tab handler