added checkPath and createDir