Window doesn't close immediately

added text to make interactivity work better