added logic for testing url for online/offline