Add check against empty directory