May have solved memory leak