changed to keydown instead of keyup