execute something before user leave the page before unload javascript