fixed demo code to use keyup instead of keydown