fixed restore if one directory's name is the same as the first letters of another