works correctly with multiple tabs and multiple browsers