Adding createDirs function to recuresively create directories