Changed code for onResume