Check for internet connection in prepare viewmodule.