multithreading enabled - memory leak