added error handling
new function: createNewDirectories()