made hideKeyboard more robustify