Added dialog for saving after clicking close button