Adding logging to see why directories aren't always created
Attempting to solve the directory creation issue