completed onResume() function