		window.onload = function getURL() {

			const JsonDB = require('node-json-db');
			const dialogs = require('dialogs')()
		    const db = new JsonDB("domain", true, true);
		    const data = db.getData("/");

		    if (data["domain"] !== undefined) {
		        window.location.href = 'https://' + data["domain"];
		    } else {
		        dialogs.prompt('Enter the URL for your Zulip server', function(url) {
		        	newurl = url.replace(/^https?:\/\//,'')
		            db.push("/domain", newurl);
		            window.location.href = 'https://' + newurl ;
		        })
		    }

		const addPlaceHolder = document.getElementsByTagName('input')[0];
		addPlaceHolder.setAttribute('placeholder', 'zulip.example.com');
		}
@@ -31,17 +31,55 @@
 URL() %7B%0A
+%09%09%09const request = require('request');
 %0A
-
 %09%09%09const
@@ -345,16 +345,17 @@
 main%22%5D;%0A
+%0A
 %09%09    %7D 
@@ -361,16 +361,24 @@
  else %7B%0A
+%09%09    %09%0A
 %09%09      
@@ -445,24 +445,25 @@
 tion(url) %7B%0A
+%0A
 %09%09        %09n
@@ -465,16 +465,20 @@
    %09
+let 
 newurl =
  url
@@ -473,16 +473,29 @@
 newurl =
+ 'https://' +
  url.rep
@@ -524,24 +524,211 @@
 )%0A%09%09        
+%09let checkURL = newurl + '/static/audio/zulip.ogg';%0A%0A%09%09        %09request(checkURL, function (error, response, body) %7B%0A%09%09        %09%09if (!error && response.statusCode !== 404) %7B%0A%09%09        %09%09%09
     db.push(
@@ -753,24 +753,27 @@
 ;%0A%09%09        
+%09%09%09
     window.l
@@ -791,29 +791,165 @@
 f = 
-'https://' + newurl ;
+newurl ;%0A%09%09        %09%09%7D%0A%09%09        %09%09else %7B%0A%09%09        %09%09%09dialogs.alert('Not valid url');%0A%09%09        %09%09%09console.log(%22Not valid url%22);%0A%09%09        %09%09%7D%0A%09%09        %09%7D)
 %0A%09%09 

validate zulip server address