Add confirmation before closing dialog