fixed weird memory leak