Change from keyup to keydown event