finish to fix memory leak