handling internet connection states