check uri before checking connectivity