Pulled mkdir out of the loop