add mkdir to fix the directory not exist bug.