The paths Array gets built every time this function is called and it's the same every time. Create a function called something like getExtensionPaths() that builds and returns the array the first time it's called, and simply returns the array on all subsequent calls.