url[url.length] is undefined