fix bug in keyup event