[Anjali] Modified the condition to check for empty directory