Fixed memory leak when running project