Added try and catch to onFocus for debugging.