implement delete_empty_dirs