change the way to determine the url to connect checking sandbox option value