fix can\'t create directory bug