fix createdirectory issue