Close app when window closes