adding check in onResume for the current state