One more attempt to fix the memory leak