handle empty directories