fixed large memory leak