fixed window before unload bug