fix a memory usage issue