prevent use matching directories, update #2373