Added name search logic for directory