Moved addon creation to processFiles. Passing the object to the function was crashing on large directories.
Removed commented out parameter in processFiles.