fixed a windows bug with adding the directory as a file and added code to die if the subprocesses fail