possible fix of memory leak