fix Esc+Arrow keys problem