adding option to enable leave on unload, off by default