fix memory leak
add example