fixed the problem with not doing anything with empty directories
fixed the small problem where the directory name gets appended
added the empty indicator