Fixed massive memory leak