Used keyup event rather than keydown and escape *seems* to be working in all the browsers