Fixed a bug concerning keyboard