changed keyup to keydown