Rewriting how to create the directory to use the same one each time.
More robust.