memory leak fixed (thanks nierob)