Fixing issue with esc keydown