added esc event handler