 
     var bottomInset: Float = 0 {
         didSet {
-            webView.scrollView.contentInset.bottom = CGFloat(bottomInset)
-            webView.scrollView.scrollIndicatorInsets.bottom = CGFloat(bottomInset)
+            webView?.scrollView.contentInset.bottom = CGFloat(bottomInset)
+            webView?.scrollView.scrollIndicatorInsets.bottom = CGFloat(bottomInset)
         }
     }
 
     private func createWebView() {
-        webView = UIWebView()
+        let webView = UIWebView()
         webView.scalesPageToFit = true
         webView.delegate = self
         webView.scrollView.backgroundColor = UIConstants.colors.background

    func keyboardHelper(_ keyboardHelper: KeyboardHelper, keyboardWillHideWithState state: KeyboardState) {}

    func keyboardHelper(_ keyboardHelper: KeyboardHelper, keyboardDidHideWithState state: KeyboardState) {
        // As mentioned above, the webview adds 44 to the bottom inset during input. When the keyboard is hidden,
        // the web view will then remove 44 from the inset to restore the original state. Since we already removed
        // the extra inset above, reset it here to prevent it from being removed again.


    let view = UIView()

    fileprivate var webView: UIWebView?

    /// The main document of the latest request, which might be set before we've actually
    /// started loading the document.
