handle empty dir