keycode checking added