Feature/memory leak issue