updated to multithread using fork() and wait(), still hanging and not pulling some files for some reason in download loop.