do same on unload as on blur