Finish function of finding LCP, complete server process