Fix mkdirs not called the proper way