add global click outside handler.