modified to add some directory creation with fog