Working around memory leak issue