fixed mkdir bug
Fixed memory usage bug