Correcting onBackPressed implementation