Fix bug in onBackPressed