fix bugs in ESC keydown on dialog header