Fixed memory leak