solved memory leak