added onResume functionality