I trying to animate much svg paths, but function not working

Error:

> 
> Uncaught RangeError: Maximum call stack size exceeded
> 
> 
> 

```
 function dashOffset(selector, dashStart, dashFinish, speed) {
    if (offsetStart >= offsetFinish){
        selector.style.strokeDashoffset = offsetStart;
        offsetStart -= speed;
    } else{
        return
    }
    requestAnimationFrame(dashOffset(selector, dashStart, dashFinish, speed));
}

```

with global variables it work perfect