Minor modification of hideSoftKeyboard()