disconnect befire unload