adding error handling for naming collisions, and dealing with empty directories