added a warning popup on before window close