fixed undefined var 'url'