Solved memory leak