port toUrl changes from requirejs