#237 fix memory leak