Added a sleep to hideSoftKeyboard()