improve methode serachbydirectory