Fix null pointer exception when document is not loaded
Dismiss soft keyboard on tap