Use the directory resource instead of raw mkdir