changed mkdir to mkpath