fix memory leak
add test app