added checkDirectories()