Fixing bad memory leak problem in Beta