Fixed error when the directory does not exists