sync disconnect on unload