disconnect on unload and tab close