add find common prefix