created enableKeyboard function