Revised function setUrl()