added onBackPressed method into MainActivity class