Apply click outside dialog to close it