Move $url to where before it is used