Deal with error from mkdir when vuild directory exists