replaced mkdir (only creates that folder) with mkdirs (creates that folder and any necessary but nonexistent parent directories)