fixed rapid-keypress bug