My `webview` module isn't working. Whenever I try to navigate back from any webpage, the app crashes giving following error

```
 "Unfortunately the app has stopped".

```

Can anyone please explain what is the reason? 

```
public class MainActivity extends ActionBarActivity {
WebView myWebView;
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    WebView mainWebView = (WebView) findViewById(R.id.mainWebView);

    WebSettings webSettings = mainWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);

    mainWebView.setWebViewClient(new MyCustomWebViewClient());
    mainWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);

    mainWebView.loadUrl("http://nahdaschools.com/v4/index.php/apps");
}

private class MyCustomWebViewClient extends WebViewClient
{
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url)
    {
        view.loadUrl(url);
        return true;
    }

}

@Override
public void onBackPressed() {
    if (myWebView.copyBackForwardList().getCurrentIndex() > 0) {
        myWebView.goBack();
    }
    else {
        // Your exit alert code, or alternatively line below to finish
        super.onBackPressed(); // finishes activity
    }
}}

```