fix a bug in Keyboard