added connectivity check in onResume