changed keydown to keyup in demo