fix memory leak in lookup process