fix memory leak #19