listen to keyup and input instead of keypress