exclude trailing / to exclude empty directory