hide when esc or click outside, reorg callback definition