Die asap when window is closed