Add error handling for bad directory names
add error mode
add error mode