use mkpath instead of mkdir